package com.embhealth.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.embhealth.dao.MemberDao;
import com.embhealth.dao.MemberExcelDao;
import com.embhealth.service.MemberExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service(interfaceClass = MemberExcelService.class)
@Transactional
public class MemberExcelServiceImpl implements MemberExcelService {

    private List<Integer> ids;

    @Autowired
    private MemberExcelDao memberExcelDao;

    @Autowired
    private MemberDao memberDao;

    /**
     * 接收到前台选中的id数据
     *
     * @param ids
     */
    @Override
    public void id_member(List<Integer> ids) {
        this.ids = ids;
    }

    /**
     * 通过会员信息导出excel数据
     *
     * @return
     * @throws Exception
     */
    @Override
    public List<Map<String, Object>> getMemberData() throws Exception {
        return memberExcelDao.membermetmeal(ids);
    }

}
